String clazzTpl({package}) => """
enum AppDebugKey {
  debugBanner,
  policy,
  dev,
  errorLog,
}

class AppDebugModel {
  late AppDebugKey key;
  late String title;
  late bool on;

  AppDebugModel({
    required this.key,
    required this.title,
    required this.on,
  });

  static AppDebugKey formatAppDebugKey(String key) {
    switch (key) {
      case 'debugBanner':
        return AppDebugKey.debugBanner;
      case 'policy':
        return AppDebugKey.policy;
      case 'dev':
        return AppDebugKey.dev;
      case 'errorLog':
        return AppDebugKey.errorLog;
      default:
        return AppDebugKey.debugBanner;
    }
  }

  AppDebugModel.fromJson(Map<String, dynamic> json) {
    key = formatAppDebugKey(json['key']);
    title = json['title'];
    on = json['on'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['key'] = this.key.toString().split('.')[1];
    data['title'] = this.title;
    data['on'] = this.on;
    return data;
  }
}

class ErrorLogFileModel {
  final String path;
  final String title;
  final bool isFile;

  const ErrorLogFileModel(
      {required this.path, required this.title, required this.isFile});
}

class ClickContinuous {
  static DateTime _lastTime = DateTime.now();
  static int _clickNum = 0;

  static void clickCheck({int num = 10, int time = 2000, void Function()? cb}) {
    if (DateTime.now().difference(_lastTime) > Duration(milliseconds: time)) {
      _lastTime = DateTime.now();
      _clickNum = 0;
    } else {
      _clickNum++;
      if (_clickNum >= num) {
        _lastTime = DateTime.now();
        _clickNum = 0;
        if (cb != null) {
          cb();
        }
      }
    }
  }
}
""";
